8d86765249bcf9cf876ef27614f9ad14efaae9ba,tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/TCAPProviderImpl.java,TCAPProviderImpl,getAvailableTxIdPreview,#,953
Before Change
private Long getAvailableTxIdPreview() throws TCAPException {
while (true) {
if (this.curDialogId < this.stack.getDialogIdRangeStart())
this.curDialogId = this.stack.getDialogIdRangeStart() - 1;
if (++this.curDialogId > this.stack.getDialogIdRangeEnd())
this.curDialogId = this.stack.getDialogIdRangeStart();
Long id = this.curDialogId;
return id;
}
After Change
private Long getAvailableTxIdPreview() throws TCAPException {
while (true) {
Long id;
if (!currentDialogId.compareAndSet(this.stack.getDialogIdRangeEnd(), this.stack.getDialogIdRangeStart() + 1)) {
id = currentDialogId.getAndIncrement();
} else {
id = this.stack.getDialogIdRangeStart();
}
return id;